# Contributor: Peng Huang <shawn.p.huang@gmail.com>
# Contributor: BYVoid <byvoid1@gmail.com>
# Contributor: Peng Wu <alexepico@gmail.com>
# Maintainer: Ziyao <ziyao@disroot.org>
pkgname=ibus-libpinyin
pkgver=1.15.7
pkgrel=0
pkgdesc="Intelligent Pinyin engine based on libpinyin for IBus"
url="https://github.com/libpinyin/ibus-libpinyin"
# armhf: no libpinyin
arch="all !armhf"
license="GPL-3.0-only"
makedepends="
	ibus-dev
	libpinyin-dev
	sqlite-dev
	"
subpackages="$pkgname-lang"
source="https://github.com/libpinyin/ibus-libpinyin/releases/download/$pkgver/ibus-libpinyin-$pkgver.tar.gz"
options="!check" # there are none

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	./configure \
		--host=$CHOST \
		--build=$CBUILD \
		--prefix=/usr \
		--libexecdir=/usr/lib/ibus
	make
}

package() {
	make install DESTDIR=$pkgdir

	# remove duplicate python bytecode
	find "$pkgdir" -name "*.opt-1.pyc" -delete
}

sha512sums="
084dc38178024ef0d13e2291c2b208c7fe431a7e8c5c4c579205480cae56cdd0076f3c2ce755353a2dc8d8e09141540431c189003a93cb85c598ee64d2947610  ibus-libpinyin-1.15.7.tar.gz
"
